package com.crape.account.dao;

import java.util.List;

import com.crape.common.exceptions.DAOException;
import com.crape.common.model.Account;
import com.crape.common.model.AccountInfo;
import com.crape.common.model.AcctRef;

public interface IAccountDAO {

	List<AccountInfo> searchAccounts(String searchValue, Integer startIndex, Integer pageSize) throws DAOException;

	Long countSearchAccounts(String searchValue) throws DAOException;

	void insertAccount(Account account) throws DAOException;

	void updateAccountUuid(Long accountid, String uuid) throws DAOException;

	void updateAccountStatus(Long accountid, Integer status) throws DAOException;

	void updateDarrenStatus(Long id, Integer usertype, Integer darrenstatus) throws DAOException;

	void updatePassword(Long id, String password) throws DAOException;

	void updateNickname(Long id, String nickname) throws DAOException;

	void deleteAccountById(Long id) throws DAOException;

	List<Account> listAccounts(Account account) throws DAOException;

	List<Account> findAccounts(Account account) throws DAOException;

	Boolean isAccountInfoExist(Long accountid) throws DAOException;

	List<AccountInfo> getAccountInfos(AccountInfo accountInfo) throws DAOException;

	Long countAllDarrens() throws DAOException;

	List<AccountInfo> getAllDarrens(Integer startIndex, Integer pageSize) throws DAOException;

	Long countDarrens(Long accountid, String email) throws DAOException;

	List<AccountInfo> getDarrens(Long accountid, String email, Integer startIndex, Integer pageSize) throws DAOException;

	void insertAccountInfo(AccountInfo accountInfo) throws DAOException;

	void updateAccountInfo(AccountInfo accountInfo) throws DAOException;

	Long updateAccountAttentionCount(Long fansid) throws DAOException;

	Long updateAccountFansCount(Long accountid) throws DAOException;

	Long updateAccountArticleCount(Long accountid) throws DAOException;

	Long updateAccountQuestionCount(Long accountid) throws DAOException;

	Long countAllUserAttentions(Long accountid) throws DAOException;

	Long countAllUserArticles(Long accountid) throws DAOException;

	Long countAllUserQuestions(Long accountid) throws DAOException;

	void insertAcctRef(AcctRef acctRef) throws DAOException;

	void deleteAcctRef(AcctRef acctRef) throws DAOException;

	void backupAcctRef(AcctRef acctRef) throws DAOException;

	List<AccountInfo> getTop8UserAttentions(Long accountid) throws DAOException;

	List<AccountInfo> getUserAttentionsByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws DAOException;

	Long countAllUserFans(Long accountid) throws DAOException;

	List<AccountInfo> getUserFansByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws DAOException;

	List<AccountInfo> getUserVisitorsByAccountid(Long accountid, Integer startIndex, Integer pageSize) throws DAOException;

	List<AccountInfo> getTop16SubjectVisitors(Long subjectid) throws DAOException;
	
	List<AccountInfo> getPagedAccountByFaq(int pagesize) throws DAOException;
	
	List<AccountInfo> getPagedAccountByFaqRef(Long questionid, Integer startIndex, Integer pageSize) throws DAOException;
	
	List<AccountInfo> getPagedAccountByAnswerRef(Long answerid, Integer type, Integer startIndex, Integer pageSize) throws DAOException;
}
